package com.sziit.se.highconcurrency.product.application.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sziit.se.highconcurrency.product.application.entity.Product;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author dongchunkeng
 * @since 2022-11-08
 */
public interface ProductMapper extends BaseMapper<Product> {


    List<Product> getAllData();

    Boolean insertProduct(
            @Param("productId")String productId,
            @Param("productName")String productName,
            @Param("inventory")Integer inventory,
            @Param("price")Float price,
            @Param("image") byte[] image
    );

    Product getOneData(@Param("productId")String productId);

    Boolean updateByProductId(Product product);

    List<Product> queryProductByPage(@Param("productName")String productName,
                                     @Param("price")Float price,
                                     @Param("index")Integer index,
                                     @Param("pageSize")Integer pageSize);

    Integer selectCount(@Param("productName")String productName,
                        @Param("price")Float price);
}
